package cc.vicp.djx314.starfood.domain.account;

import java.io.Serializable;
import java.util.Date;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;

import org.hibernate.validator.constraints.Length;

public class User implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 2131460451623267276L;
	/**
	 * 自增主键
	 */
	private Integer id;
	@NotNull(message = "昵称不能为空")
	@Length(min = 3, max = 12, message = "昵称必须在3-12个字符以内")
	private String nickName;
	@NotNull(message = "真实姓名不能为空")
	@Length(min = 3, max = 12, message = "真实姓名必须在3-12个字符以内")
	private String trueName;
	@Length(max = 60, message = "地址必须在60个汉字以下")
	private String address;
	@Length(max = 20, message = "电话号码必须在20个数字以下")
	private String phone;
	private Boolean sex;  //无需验证是否为空
	@Past(message = "生日必须是一个过去的日期")
	private Date birthday;
	private String likeDish;
	private String notLikeDish;
	@Valid
	private Account account;

	public User() {
		super();
	}

	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getNickName() {
		return nickName;
	}
	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	public String getTrueName() {
		return trueName;
	}
	public void setTrueName(String trueName) {
		this.trueName = trueName;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public Boolean getSex() {
		return sex;
	}
	public void setSex(Boolean sex) {
		this.sex = sex;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public String getLikeDish() {
		return likeDish;
	}
	public void setLikeDish(String likeDish) {
		this.likeDish = likeDish;
	}
	public String getNotLikeDish() {
		return notLikeDish;
	}
	public void setNotLikeDish(String notLikeDish) {
		this.notLikeDish = notLikeDish;
	}
	public Account getAccount() {
		return account;
	}
	public void setAccount(Account account) {
		this.account = account;
	}
}